#pragma once

#include <mysql/mysql.h>
#include <iostream>
using namespace std;

/**************************
mysql操作的api
***************************/
class MysqlOpt
{
private:
    MYSQL *conn=nullptr;
    const char* host=nullptr;
    const char* username=nullptr;
    const char* passwd=nullptr;
    const char* datebase=nullptr;
    unsigned int port=3306;
public:
    MysqlOpt(const char* _host,const char* _username,const char* _passwd,
                        const char* _datebase, unsigned int _port);
    bool mysql_connect();
    bool mysql_create_table();
    bool mysql_insert_data(int num);
    void mysql_set_character_set(const char* character_set);
    void mysql_close();
    ~MysqlOpt();
};
